<?php
namespace Home\Controller;
use Think\Controller;
class ListController extends CommonController {
    public function index(){
    	$article = D('article');
    	$count = $article->count();
    	$page = new \Think\Page($count,3);
		$page->setConfig('first', '首页');
	    $page->setConfig('prev', '上一页');  
	    $page->setConfig('next', '下一页');  
	    $page->setConfig('last', '末页');
	    $page->setConfig('header', '<li class="rows">共<b>%TOTAL_ROW%</b>篇文章 <b>%NOW_PAGE%</b>/<b>%TOTAL_PAGE%</b>页</li>');     
	    $page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');  
	    $page->lastSuffix = false;//最后一页不显示为总页数  
    	$show = $page->show();
    	$list = $article->limit($page->firstRow.','.$page->listRows)->select();
    	$this->assign('list',$list);
    	$this->assign('page',$show);
        $this->display();
    }
}